<!--
*Author：DGZ
 *Contact：jiduxiong@dagongzao.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/basproject/barcode/Bas_BarcodeRule.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :details="details"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/basproject/barcode/Bas_BarcodeRule.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        name: "barcode/Bas_BarcodeRule",
        setup() {
            const table = ref({
                key: "BarcodeRuleId",
                footer: "Foots",
                cnName: "条码规则",
                name: "barcode/Bas_BarcodeRule",
                newTabEdit: false,
                url: "/Bas_BarcodeRule/",
                sortName: "BarcodeRuleId"
            });
            const editFormFields = ref({"RuleCode":"","RuleName":"","RuleDesc":"","SplitChar":"","RuleType":"","IsCommon":"","Remarks":""});
            const editFormOptions = ref([[{"title":"条码编码代号","required":true,"field":"RuleCode"},
                               {"title":"条码编码名","required":true,"field":"RuleName"}],
                              [{"title":"条码编码描述","field":"RuleDesc"},
                               {"title":"条码分隔符","field":"SplitChar"}],
                              [{"dataKey":"BASE_BarCodeType","data":[],"title":"条码类型","field":"RuleType","type":"select"},
                               {"dataKey":"enabled","data":[],"title":"通用","field":"IsCommon","type":"switch"}],
                              [{"title":"备注","field":"Remarks","colSize":12,"type":"textarea"}]]);
            const searchFormFields = ref({"RuleCode":"","RuleName":"","RuleType":"","IsCommon":""});
            const searchFormOptions = ref([[{"title":"条码编码代号","field":"RuleCode","type":"like"},{"title":"条码编码名","field":"RuleName","type":"like"}],[{"dataKey":"BASE_BarCodeType","data":[],"title":"条码类型","field":"RuleType","type":"select"},{"dataKey":"enabled","data":[],"title":"通用","field":"IsCommon","type":"select"}]]);
            const columns = ref([{field:"BarcodeRuleId",title:"ID",type:"bigint",width:110,hidden:true,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"RuleCode",title:"条码编码代号",type:"string",link:true,width:120,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"RuleName",title:"条码编码名",type:"string",width:180,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"RuleDesc",title:"条码编码描述",type:"string",width:150,showOverflowTooltip:true,align:"left"},
                       {field:"SplitChar",title:"条码分隔符",type:"string",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"RuleType",title:"条码类型",type:"int",bind:{ key:"BASE_BarCodeType",data:[]},width:110,showOverflowTooltip:true,align:"left"},
                       {field:"IsCommon",title:"通用",type:"int",bind:{ key:"enabled",data:[]},width:60,showOverflowTooltip:true,align:"left"},
                       {field:"Level",title:"条码层级",type:"string",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"IsValid",title:"是否有效",type:"int",width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"CreateId",title:"创建用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Creator",title:"创建人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"CreateTime",title:"创建时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyId",title:"修改用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Modifier",title:"修改人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyTime",title:"修改时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"Remarks",title:"备注",type:"string",width:150,showOverflowTooltip:true,align:"left"}]);
            const detail = ref(  {
                    cnName: "条码规则明细",
                    table: "Bas_BarcodeRuleDetail",
                    columns: [{field:"BarcodeRuleDetailId",title:"ID",type:"bigint",width:110,hidden:true,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"BarcodeRuleId",title:"条码规则ID",type:"bigint",width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"BarcodeElementId",title:"条码要素",type:"bigint",bind:{ key:"BASE_BarcodeElement",data:[]},width:110,edit:{type:"select"},require:true,showOverflowTooltip:true,align:"left"},
                       {field:"FieldValue",title:"区段值",type:"string",width:180,edit:{type:""},showOverflowTooltip:true,align:"left"},
                       {field:"Length",title:"区段长度",type:"int",width:110,edit:{type:""},showOverflowTooltip:true,align:"left"},
                       {field:"FieldStartValue",title:"起始值",type:"string",width:180,edit:{type:""},showOverflowTooltip:true,align:"left"},
                       {field:"ResetFlag",title:"是否为重置条件",type:"int",bind:{ key:"enabled",data:[]},width:110,edit:{type:"switch"},showOverflowTooltip:true,align:"left"},
                       {field:"ResetStartValue",title:"重置值",type:"string",width:180,edit:{type:""},showOverflowTooltip:true,align:"left"},
                       {field:"IsValid",title:"是否有效",type:"int",width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"CreateId",title:"创建用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Creator",title:"创建人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"CreateTime",title:"创建时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyId",title:"修改用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Modifier",title:"修改人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyTime",title:"修改时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"Remarks",title:"备注",type:"string",width:150,edit:{type:"textarea"},showOverflowTooltip:true,align:"left"},
                       {field:"Seq",title:"Seq",type:"int",width:120,showOverflowTooltip:true,align:"left"}],
                    sortName: "Seq",
                    key: "BarcodeRuleDetailId"
                                            });
            const details = ref([]);
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
                details
            };
        },
    });
</script>
